import unittest
from shzcsv import*

class MyTestCase(unittest.TestCase):
    def test_something(self):
        name_list = ['宋江','鲁智深 ', '花荣', '武松',  '吴用','高俅','史进 ', '卢俊义','李逵', '林冲', '杨志', '戴宗','时迁']
        txt_path = 'D:\shz.txt'
        name_list_count = [2765, 1247, 1151, 759, 647, 639, 632, 343, 282, 242, 239, 216,183]
        items = list()
        for i in range(13):
            items.append([name_list[i], name_list_count[i]])
        self.assertEqual(items, NameCount().getNameTimesSort(name_list, txt_path))


if __name__ == '__main__':
    unittest.main()
